import Observer from "./Observer.js"
import Watcher from "./Watcher.js";


const vm = {
    data: {
        name: 'lin',
        age: 20,
        list: [1,2],
        son: {
            name: "joe",
            age: 1,
        }
    } 
}


new Observer(vm.data);


let w = {
    update(newV,oldV) {
        console.log("update:",newV,oldV);
    }
} 

new Watcher(vm,"data.list",w);


vm.data.list.push(1);